GXGetShapeDirection
You can use theGXGetShapeDirection
function to determine whether a contour has a clockwise or counterclockwise direction.
gxContourDirection GXGetShapeDirection(gxShape source, long contour);
source
- A reference to the shape containing the contour.
contour
- The contour index of the contour whose direction you want to determine.
- function result
- The direction of the contour, either
gxClockwiseDirection
orgxCounterclockwiseDirection
.DESCRIPTION
TheGXGetShapeDirection
function indicates whether QuickDraw GX considers the contour indicated by thecontour
parameter of the shape indicated by thesource
parameter to be clockwise or counterclockwise. You can use this information to determine how QuickDraw GX will draw a shape that has thegxInsideFrameStyle
orgxOutsideFrameStyle
style attribute set, or how theGXInsetShape
function affects a shape.For empty and full shapes, this function posts the error
graphic_type_does_not_have_multiple_contours
.For point shapes and line shapes, this function always returns
gxClockwiseDirection
. Although the order of the geometric points in a line shape's geometry does not affect the result of this function, it may affect how QuickDraw GX draws the line. For example, if the line is dashed, the order of the geometric points determines the end of the line at which dashing begins. Also, if the line has a pen width and thegxInsideFrameStyle
orgxOutsideFrameStyle
style attribute is set, the order of the geometric points determines the side of the geometry on which QuickDraw GX draws the line.For rectangle shapes, the result of this function is determined by examining which corners are specified by the geometric points. For a rectangle whose geometry includes the upper-left point and the lower-right point, this function returns
gxClockwiseDirection
, regardless of the order of the two points in the geometry. For a rectangle whose geometry includes the upper-right point and the lower-left point, this function returnsgxCounterclockwiseDirection
, again regardless of the order of the two points.For curve shapes, polygon shapes, and path shapes, reversing the order of any contour's geometric points reverses the result of this function.
If you provide a source shape that is not one of the geometric shape types, this function performs the actions described in the following table:
Shape type Action taken bitmap Posts the error graphic_type_does_not_have_multiple_contours
picture Posts the error graphic_type_does_not_have_multiple_contours
text Posts the error illegal_type_for_shape
glyph Posts the error illegal_type_for_shape
layout Posts the error illegal_type_for_shape
ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil contour_is_less_than_zero (debugging version) illegal_type_for_shape (debugging version) graphic_type_does_not_have_multiple_contours (debugging version) Warnings contour_out_of_range SEE ALSO
For examples using this function, see "Determining and Reversing Contour Direction" beginning on page 4-23.To reverse the order of geometric points in a shape's geometry, use the
GXReverseShape
function, described in the next section.For a description of the
GXInsetShape
function, see page 4-94. For a description of thegxInsideFrameStyle
andgxOutsideFrameStyle
style attributes, see Chapter 3, "Geometric Styles," in this book.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help